package com.jt.mapper;

import com.jt.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
public interface UserMapper {
    List<User> findAll();
    @Select("select * from demo_user where id = #{id}")
    User findUserById(Integer id);
    @Select("select * from demo_user where name = #{name}")
    User findUserByName(String name);
    @Select("select * from demo_user where age=#{age} and sex=#{sex}")
    List<User> findUserByAs(User user);
    @Update("update demo_user set name=#{name},age=#{age},sex=#{sex} where id=#{id}")
    void updateById(User user);

    List<User> findUserByLike(User user);

    List<User> findUserByIds(int[] ids);

//    @Insert("insert into demo_user(id,name,age,sex) values(null,#{name},#{age},#{sex})")
    void saveUser(User user);
}
